<?php

$api->version('v1', ['namespace' => 'App\Http\Controllers','middleware' => ['cors']],
function ($api) {
    $api->any('/t', 'TestController@index');
    $api->any('/t2', 'TestController@index');

    // need authentication
    $api->group(['middleware' => 'auth'], function ($api) {
        $api->get('/t1', 'TestController@index');
    });

});